package dayPractice;

import java.util.*;

/**
 * @author Summerday
 */
public class Main1371 {

    static int n, m;
    static int[] nums;
    static List<Integer> sg;
    static List<List<Integer>> res;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        m = scanner.nextInt();
        nums = new int[n];
        sg = new ArrayList<>();
        res = new ArrayList<>();
        for (int i = 0; i < n; i++) nums[i] = scanner.nextInt();
        Arrays.sort(nums);
        dfs(0, 0);
        System.out.println(res.size());
        res.forEach(System.out::println);
    }

    /**
     * @param u   当前第几位  1 2 5
     * @param sum 当前的总数是第几了
     */
    static void dfs(int u, int sum) {

        if(u == n || sum >= m){
            if(sum == m){
                ArrayList<Integer> list = new ArrayList<>(sg);
                Collections.sort(list);
                if(!res.contains(list)){
                    res.add(list);
                }
            }
            return ;
        }

        for(int i = u; i < n; i ++){
            if(nums[i] > m - sum) break;
            sg.add(nums[i]);
            dfs(u , sum + nums[i]);
            sg.remove(sg.size() - 1);
        }
    }
}
